﻿//=====================================================================
//==                  2011 www.21ce.cc By Jeff              ==
//==                     www.21ce.cc                        ==
//==                                           ==
//=====================================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WFinger.CMS;

public partial class user_friend_Establishment : WFinger.Web.UI.UserPage
{
    Friend fri = new Friend();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            
            string UserNum = WFinger.Global.Current.UserNum;
            int fE = 0;
            if (fri.sel_6(UserNum) != null && fri.sel_6(UserNum) != "")
            {
                fE = int.Parse(fri.sel_6(UserNum));
                switch (fE)
                {
                    case 0:
                        this.RadioButtonList1.Items[2].Selected = true;
                        break;
                    case 1:
                        this.RadioButtonList1.Items[1].Selected = true;
                        break;
                    case 2:
                        this.RadioButtonList1.Items[0].Selected = true;
                        break;
                }
            }
        }
    }
    protected void addfriend_Click(object sender, EventArgs e)
    {
        string UserNum = WFinger.Global.Current.UserNum;
        int FE = int.Parse(this.RadioButtonList1.SelectedValue);
        if (fri.Update(FE, UserNum)==0)
        {
            PageError("设置失败", "friendList.aspx");
        }
        else 
        {
            PageRight("设置成功", "friendList.aspx");
        }
    }
}
